package com.yupi.usercenter.exception;

import com.yupi.usercenter.common.ErrorCode;
import lombok.Data;

@Data
public class BusinessException extends RuntimeException{
    private String description;
    private int code;

    public BusinessException(String message, String description, int code) {
        super(message);
        this.description = description;
        this.code = code;
    }
    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        this.description = errorCode.getDescription();
        this.code = errorCode.getCode();
    }
    public BusinessException(ErrorCode errorCode,String description) {
        super(errorCode.getMsg());
        this.description =description;
        this.code = errorCode.getCode();
    }

}
